package com.suntianci.stock.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName User
 * @Author 孙天赐
 * @Date 2024/12/28 14:39
 * @Description TODO:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@HeadRowHeight(value = 35) // 表头行高
@ContentRowHeight(value = 25) // 内容行高
@ColumnWidth(value = 50) // 列宽
public class User implements Serializable {
    @ExcelProperty(value = {"基本信息", "用户名"}, index = 0)  // 设置导出到excel表格是的列名
    private String userName;

    @ExcelProperty(value = {"基本信息", "年龄"}, index = 1)
    private Integer age;

    @ExcelProperty(value = {"基本信息", "地址"}, index = 2)
    @ExcelIgnore  // 导出为excel表格时，忽略这一列（不导出这一列数据）
    private String address;

    @ExcelProperty(value = {"基本信息", "生日"}, index = 3)
    @DateTimeFormat("yyyy-MM-dd")
    private Date birthday;
}
